const Router = require('koa-router')

const {
  listValidator,
  delValidator,
} = require('../middleware/validator/sys_user_online')
// validateToken, validateAdmin 有先后顺序 先校验token再校验管理员
const { validateToken, validateAdmin } = require('../middleware/auth/token')

const { list, del } = require('../controller/sys_user_online')
const PREFIX = '/v1/sys_user_online'

const router = new Router({ prefix: PREFIX })

router.get('/list', listValidator, validateToken, validateAdmin, list)

router.del('/del', delValidator, validateToken, validateAdmin, del)

module.exports = router
